<? 

	$title="Delete member"; 
	$pageid="2";
	$accessid="a00";

	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	
	
	if(isset($_POST['btnsubmit']))
	{
		$id=$_POST['hidid'];
		$get_info=mysql_query("select * from os_uploadfiles where id=$id");
		$m=mysql_fetch_array($get_info,MYSQL_ASSOC);
		
		$product_pic="../uploadfiles/".$m['filename'].".gif";
			
		unlink($product_pic);
		
		
		
		$delete_product=mysql_query("delete from os_uploadfiles where id=$id");
?>
<table>
	<tr>
	
	
	<td align="left" valign="top">
		<table width="80%" cellpadding="2" cellspacing="1" >
		<tr>
		<td colspan="2" align="left" style="background: url(images/tbl_th.png);color:#FFFFFF" >
			<font color="#FFFFFF"><strong>Delete Upload Files</strong></font>
		</td>
	</tr>
	<tr>
		<td></td><td>File successfully deleted!</td>
	</tr>
	<tr>
		<td></td><td><input type="button" value="Back" class="button" name="btnsubmit" onClick="window.open('collection_file_upload.php','_self')"> </td>
	</tr>
	</table>
	</td>
</table>
<?		
			
	}
	else
	{
		$id=$_GET['id'];
		
		$get_file=mysql_query("select * from os_uploadfiles where id=$id");
		
		if(mysql_num_rows($get_file)==0)
		{
			die("no file found!");
		}
		
		$a=mysql_fetch_array($get_file,MYSQL_ASSOC);
	
	
?>
<table width="100%">
	
	<td align="left" valign="top">
		<table width="80%" cellpadding="2" cellspacing="1">
		<tr>
			<td height="20" colspan="2" align="left" class="title">
				Delete Upload Files
			</td>
		</tr>
		<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
		
		
		<input type="hidden" value="<?= $id ?>" name="hidid">
		<tr>
			<td><input type="submit" value="Yes" class="button" name="btnsubmit"> <input type="button" value="No" class="button" onClick="history.go(-1)"></td>
		</tr>
		</form>		
		</table>
	</td>
</table>
<? }require("required/footer.php"); ?>

